import React from "react";
import * as actions from "../actions";
import { connect } from "react-redux";
import { bindActionCreators } from "redux";
import ObjectList from "../components/ObjectList";
import { Ids } from "../../index";

class ListPageContainer extends React.Component {
  constructor(props: any) {
    super(props);
  }
  render() {
    return <ObjectList {...this.props} componentId={Ids.OBJECT_LIST_PAGE} />;
  }
}

// 将Reducer中的数据拿出来
const mapStateToProps = (state: any) => {
  return { state: state.reducer };
};
// 将Action函数注入到props
const mapDispatchToProps = (dispatch: any) => ({
  actions: bindActionCreators(actions, dispatch),
});
export default connect(mapStateToProps, mapDispatchToProps)(ListPageContainer);
